package behaviour.command.command_demo2;

import java.util.Arrays;
import java.util.List;

/**
 * java8实现命令模式很简单
 *
 * @author yeyangtao created at 16:50 2020/11/9
 */
public class CommandJava8 {
    public static void main(String[] args) {
        List<Runnable> runs = Arrays.asList(
                () -> System.out.print("hello "),
                () -> System.out.println("world!"),
                () -> System.out.println("It is command pattern")
        );
        runs.forEach(Runnable::run);
    }
}
